<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <h1>学生信息列表</h1>
  <table border="1" width="600">
    <thead>
      <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>入学时间</th>
        <th>所属学院</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody align="center">
    {{if list.length != 0}}
      {{each list value}}
      <tr>
        <td>{{value.sno}}</td>
        <td>{{value.sname}}</td>
        <td>{{value.sage}}</td>
        <td>{{value.sgender}}</td>
        <td>{{value.stime}}</td>
        <td>{{value.dname}}</td>
        <td>
          <a href="/delstu?no={{value.sno}}" onclick="return confirm('您确定要删除么')">删除</a>
          <a href="/editstu?no={{value.sno}}">修改</a>
        </td>
      </tr> 
      {{/each}}
    {{else}}
      <tr><td colspan="6" >没有相关数据</td></tr>
    {{/if}}
    </tbody>
  </table>
  <!-- <script>
    let a = document.querySelectorAll("a");
    for(var i = 0;i<a.length;i++){
      a[i].onclick = function(){
        if(confirm("您确定要删除么")==false){
          return
        };
      };
    }
  </script> -->
</body>
</html>
 





<!-- <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <h1>学生信息列表</h1>
  <table border="1" width="600px">
    <thead>
      <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>入学时间</th>
        <th>所属院校</th>
      </tr>
    </thead>
    <tbody align="center">
      {{if list.length != 0}}
        {{each list value}}
        <tr>
          <td>{{value.sno}}</td>
          <td>{{value.sname}}</td>
          <td>{{value.sage}}</td>
          <td>{{value.sgender}}</td>
          <td>{{value.stime}}</td>
          <td>{{value.dname}}</td>
        </tr>
        {{/each}}
      {{else}}
        <tr><td colspan="6">没有相关数据</td></tr>
      {{/if}}
    </tbody>
  </table>
</body>
</html> -->
